home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / cluster.zip / CLUSTER.QC < prev    next >
Text File  |  1996-08-08  |  2KB  |  89 lines

  1. void() GrenadeExplode;
  2. void() GrenadeTouch;
  3. void() BecomeExplosion;
  4. float() crandom;
  5.  
  6. float WP_CLUSTER = 1;
  7. float IM_CLUSTER = 70;
  8.  
  9. void() ClusterExplode = 
  10. {
  11.     local entity missile;
  12.     local float tmp;
  13.     
  14.     T_RadiusDamage (self, self.owner, 120, world);
  15.     
  16.     WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  17.     WriteByte (MSG_BROADCAST, TE_EXPLOSION);
  18.     WriteCoord (MSG_BROADCAST, self.origin_x);
  19.     WriteCoord (MSG_BROADCAST, self.origin_y);
  20.     WriteCoord (MSG_BROADCAST, self.origin_z);
  21.     
  22.     tmp =0;
  23.     while (tmp <7)
  24.     {
  25.         missile=spawn();
  26.         missile.owner = self.owner;
  27.         missile.movetype = MOVETYPE_BOUNCE;
  28.         missile.solid = SOLID_BBOX;
  29.         missile.classname = "grenade";
  30.         missile.think = GrenadeExplode;
  31.         missile.nextthink = time+1.5;
  32.         missile.velocity_z=500;
  33.         missile.velocity_x=400*random() - 200;
  34.         missile.velocity_y=400*random() - 200;
  35.         missile.avelocity= '300 300 300';
  36.         missile.angles=vectoangles(missile.velocity);
  37.         missile.touch=GrenadeTouch;
  38.         setmodel(missile,"progs/grenade.mdl");
  39.         setsize(missile,'0 0 0','0 0 0');
  40.         setorigin(missile,self.origin);
  41.         tmp=tmp+1;
  42.     }
  43.     BecomeExplosion();
  44. };
  45.     
  46. void() ClusterTouch =
  47. {
  48.     if (other == self.owner)
  49.         return;
  50.     if (other.takedamage == DAMAGE_AIM)
  51.     {
  52.         ClusterExplode();
  53.         return;
  54.     }
  55.     sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM);
  56.     if (self.velocity == '0 0 0')
  57.         self.avelocity = '0 0 0';
  58. };
  59.  
  60. void() W_FireCluster =
  61. {
  62.     local entity missile;
  63.     self.currentammo = self.ammo_rockets = self.ammo_rockets - 7;
  64.     sound (self,CHAN_WEAPON,"weapons/grenade.wav", 1, ATTN_NORM);
  65.     self.punchangle_x= -2;
  66.     missile=spawn();
  67.     missile.owner=self;
  68.     missile.movetype=MOVETYPE_BOUNCE;
  69.     missile.solid=SOLID_BBOX;
  70.     missile.classname="clusterbomb";
  71.     makevectors(self.v_angle);
  72.     if(self.v_angle_x)
  73.         missile.velocity=v_forward*600+v_up*200+crandom()*v_right*10+crandom()*v_up*10;
  74.     else
  75.     {
  76.         missile.velocity = aim(self,10000);
  77.         missile.velocity=missile.velocity*600;
  78.         missile.velocity_z=200;
  79.     }
  80.     missile.avelocity='300 300 300';
  81.     missile.angles=vectoangles(missile.velocity);
  82.     missile.touch=ClusterTouch;
  83.     missile.nextthink=time+1.5;
  84.     missile.think=ClusterExplode;
  85.     setmodel(missile,"progs/grenade.mdl");
  86.     setsize(missile,'0 0 0','0 0 0');
  87.     setorigin(missile,self.origin);
  88. };
  89.